package com.huitone.gddw.service.dto.monitoring.environment;

import com.huitone.gddw.common.excel.ColToProperty;
import com.huitone.gddw.common.excel.TabCol;

/**
 * redis监控
 * @author wuluodan
 *
 */
public class RedisMonitorDTO {

	private String objId;
	
	private String itemId;
	
	@ColToProperty
	@TabCol(Index = 1, title = "序号", width = "")
	private Integer seq;
	
	@ColToProperty
	@TabCol(Index = 2, title = "角色", width = "")
	private String role;
	
	@ColToProperty
	@TabCol(Index = 3, title = "IP", width = "")
	private String ip;
	
	@ColToProperty
	@TabCol(Index = 4, title = "主（从）", width = "")
	private String rltip;
	
	@ColToProperty
	@TabCol(Index = 5, title = "连接个数", width = "")
	private String links;
	
	@ColToProperty
	@TabCol(Index = 6, title = "连接使用率", width = "")
	private String linkuse;
	
	@ColToProperty
	@TabCol(Index = 7, title = "使用内存", width = "")
	private String pidmemuse;
	
	@ColToProperty
	@TabCol(Index = 8, title = "内存使用率", width = "")
	private String memuse;
	
	@ColToProperty
	@TabCol(Index = 9, title = "预警数", width = "")
	private Long warnCount;
	
	private String recvMan;
	
	@ColToProperty
	@TabCol(Index = 10, title = "负责人", width = "")
	private String userName;
	
	@ColToProperty
	@TabCol(Index = 11, title = "手机号码", width = "")
	private String phoneNumber;

	@ColToProperty
	@TabCol(Index = 12, title = "邮箱", width = "")
	private String mailBox;

	public String getObjId() {
		return objId;
	}

	public void setObjId(String objId) {
		this.objId = objId;
	}

	public String getItemId() {
		return itemId;
	}

	public void setItemId(String itemId) {
		this.itemId = itemId;
	}

	public Integer getSeq() {
		return seq;
	}

	public void setSeq(Integer seq) {
		this.seq = seq;
	}

	public String getRole() {
		return role;
	}

	public void setRole(String role) {
		this.role = role;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public String getRltip() {
		return rltip;
	}

	public void setRltip(String rltip) {
		this.rltip = rltip;
	}

	public String getLinks() {
		return links;
	}

	public void setLinks(String links) {
		this.links = links;
	}

	public String getLinkuse() {
		return linkuse;
	}

	public void setLinkuse(String linkuse) {
		this.linkuse = linkuse;
	}

	public String getPidmemuse() {
		return pidmemuse;
	}

	public void setPidmemuse(String pidmemuse) {
		this.pidmemuse = pidmemuse;
	}

	public String getMemuse() {
		return memuse;
	}

	public void setMemuse(String memuse) {
		this.memuse = memuse;
	}

	public Long getWarnCount() {
		return warnCount;
	}

	public void setWarnCount(Long warnCount) {
		this.warnCount = warnCount;
	}

	public String getRecvMan() {
		return recvMan;
	}

	public void setRecvMan(String recvMan) {
		this.recvMan = recvMan;
	}

	public String getUserName() {
		return getsplit() == null ? "" : getsplit()[1];
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPhoneNumber() {
		return getsplit() == null ? "" : getsplit()[2];
	}

	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}

	public String getMailBox() {
		return getsplit() == null ? "" : getsplit()[3];
	}

	public void setMailBox(String mailBox) {
		this.mailBox = mailBox;
	}
	
	public String[] getsplit() {
		if (null == this.recvMan) {
			return null;
		}
		return this.recvMan.split(",");
	}
	
	public void setValue(String key, String value) {
		if (key.equals("role")) this.role = value;
		else if (key.equals("ip")) this.ip = value;
		else if (key.equals("rltip")) this.rltip = value;
		else if (key.equals("links")) this.links = value;
		else if (key.equals("linkuse")) this.linkuse = value;
		else if (key.equals("pidmemuse")) this.pidmemuse = value;
		else if (key.equals("memuse")) this.memuse = value;
	}
	
}
